#define _CRT_SECURE_NO_WARNINGS

//Problem 01
//bool isSameTree(struct TreeNode* p, struct TreeNode* q) {
//    if (p == NULL && q == NULL)
//        return true;
//    if (p == NULL || q == NULL)
//        return false;
//
//    if (p->val != q->val)
//        return false;
//
//    return isSameTree(p->left, q->left) && isSameTree(p->right, q->right);
//}

/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
 *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
 *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
 * };
 */


//
//bool isSymmetricTree(TreeNode* Tleft, TreeNode* Tright)
//{
//    if (Tleft == NULL && Tright == NULL)
//        return true;
//    if (Tleft == NULL || Tright == NULL || Tleft->val != Tright->val)
//        return false;
//    return isSymmetricTree(Tleft->left, Tright->right) && isSymmetricTree(Tleft->right, Tright->left);
//}
//
//bool isSymmetric(struct TreeNode* root) {
//        return isSymmetricTree(root->left, root->right);
//}
//
//TreeNode* CreateTreeNode(int val)
//{
//    TreeNode* Node = (TreeNode*)malloc(sizeof(TreeNode));
//    Node->val = val;
//    Node->left = NULL;
//    Node->right = NULL;
//
//    return Node;
//}
//
//int main()
//{
//    TreeNode* n1 = CreateTreeNode(1);
//    TreeNode* n2 = CreateTreeNode(2);
//    TreeNode* n3 = CreateTreeNode(2);
//    TreeNode* n4 = CreateTreeNode(3);
//    TreeNode* n5 = CreateTreeNode(4);
//    TreeNode* n6 = CreateTreeNode(4);
//    TreeNode* n7 = CreateTreeNode(3);
//    n1->left = n2;
//    n1->right = n3;
//    n2->left = n4;
//    n2->right = n5;
//    n3->left = n6;
//    n3->right = n7;
//
//    bool ret = isSymmetric(n1);
//    printf("%d\n", ret);
//
//    return 0;
//}

